<template>
  <div class="app-container">
    <div>
      <el-timeline :reverse="reverse" >
<!--        <el-timeline-item-->
<!--          v-for="(activity, index) in orderList"-->
<!--          :key="index"-->
<!--          :timestamp="parseTime(activity.gmtTime)">-->
<!--          {{activity.remark}}-->
<!--        </el-timeline-item>   -->



        <el-timeline-item
          v-for="(activity, index) in orderList"
          :key="index"
          :timestamp="parseTime(activity.gmtTime)" placement="top">
          <el-card>
            <h4>{{activity.state}}</h4>
            <p>{{activity.remark}}</p>
          </el-card>
        </el-timeline-item>

      </el-timeline>
    </div>

  </div>
</template>

<script>
  import {listTimeline} from "@/api/order/timeline";

  export default {
    name: "Order",
    props: {
      orderId: {
        type: Number
      }
    },
    data() {
      return {
        reverse:true,
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        orderList: [],
        queryParams: {
          pageNum: 1,
          pageSize: 20,
          orderId:this.orderId
        }
      };
    },
    created() {
      this.getList();
    },
    methods: {
      /** 查询订单列表 */
      getList() {
        this.loading = true;
        listTimeline(this.queryParams).then(response => {
          this.orderList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      }
    }
  };
</script>
